package dfsketches.gr3d;

public class ExtendedCutter extends SimpleCutter {

	public ExtendedCutter(Renderer r) {
		super(r);
	}
	
	@Override
	public void render(Triangle t, Projector p) {
		final float f = 0.005f;
		Vertex a = t.a, b = t.b, c = t.c;
		float ax = a.x, ay = a.y, az = a.z;
		float bx = b.x, by = b.y, bz = b.z;
		float cx = c.x, cy = c.y, cz = c.z;
		a.x += (ax + ax - cx - bx) * f;
		a.y += (ay + ay - cy - by) * f;
		a.z += (az + az - cz - bz) * f;
		b.x += (bx + bx - cx - ax) * f;
		b.y += (by + by - cy - ay) * f;
		b.z += (bz + bz - cz - az) * f;
		c.x += (cx + cx - ax - bx) * f;
		c.y += (cy + cy - ay - by) * f;
		c.z += (cz + cz - az - bz) * f;
		super.render(t, p);
	}

}
